Each WEND statement must have a matching WHILE statement. Also, verify that other control structures within the WHILE...WEND structure are correctly matched. For example, an IF without a matching ENDIF inside the WHILE...WEND structure will generate this error. ERR Code: 30